package com.guang.alicloud.feign.api.api;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SentielFallbackFactory implements FallbackFactory<ProductCenterFeignApi> {
    @Override
    public ProductCenterFeignApi create(Throwable throwable) {
        return new ProductCenterFeignApi() {
            @Override
            public String selectProductInfoById(String productNo) {
                System.out.println("熔断了" + productNo);
                return "熔断了" + productNo;
            }
        };
    }
}
